/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.myapp.struts;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author Vinu
 */
public class Login extends org.apache.struts.action.ActionForm {
    
    private String login;
    private String status;
    private String password;

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

   
    public void delete()
    {
    this.login="";
    this.password="";
    this.status="";
    
    }
    /**
     *
     */
    public Login() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * This is the action called from the Struts framework.
     *
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
                if (getLogin() == null || getLogin().length() < 1) { 
        errors.add("login", new ActionMessage("error :login required"));
        } 
        if (getPassword() == null || getPassword().length() < 1) { 
        errors.add("passwordEmpty", new ActionMessage("error : password required")); 
        } 

        return errors; 
    }
}
